#include<reg52.h>
sbit s2=P3^4;
sbit s3=P3^5;
sbit s4=P3^6;
sbit s5=P3^7;
sbit led1=P2^0;
sbit led2=P2^1;
sbit led3=P2^2;
sbit led4=P2^3;

void delay(unsigned char p)
{
unsigned char m,n;
	for(m=p;m>0;m--)
		for(n=125;n>0;n--);
}
void main()
{
while(1)
{
	if(s2==0)
	{
			delay(10);
			if(s2==0)
			{
				while(!s2);
				led1=~led1;
			}

	}
	if(s3==0)
	{
			delay(10);
			if(s3==0)
			{
				while(!s3);
				led2=~led2;
			}

	}
	if(s4==0)
	{
			delay(10);
			if(s4==0)
			{
				while(!s4);
				led3=~led3;
			}

	}
	if(s5==0)
	{
			delay(10);
			if(s5==0)
			{
				while(!s5);
				led4=~led4;
			}

	}

	}
}
